package com.xjscrm.console.web.group;

import com.xjscrm.console.param.group.AcceptGroupInviteDto;
import com.xjscrm.console.param.group.AcceptGroupInviteQuery;
import com.xjscrm.console.param.group.AutoAcceptInviteSwitchDto;
import com.xjscrm.console.service.customer.group.WwGroupInviteService;
import com.xjscrm.console.vo.AcceptGroupInviteVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Api(value = "接受群邀请管理", tags = "接受群邀请管理")
@RestController
@RequestMapping(value = "/wwGroup/invite")
public class WwGroupInviteController {


 @Autowired
 private WwGroupInviteService wwGroupInviteService;

    @ApiOperation(value = "设置接受群邀请机器人配置", notes = "设置接受群邀请机器人配置",response = Boolean.class)
    @PostMapping(value ="/addAcceptGroupInvite" )
    public Object addAcceptGroupInvite(@RequestBody AcceptGroupInviteDto acceptGroupInviteDto)throws Exception{
        wwGroupInviteService.addAcceptGroupInvite(acceptGroupInviteDto);
         return true;
    }

    @ApiOperation(value = "查询接受群邀请机器人配置列表", notes = "查询接受群邀请机器人配置列表",response = AcceptGroupInviteVo.class)
    @PostMapping(value ="/getAccpetGroupInviteList" )
    public Object getAccpetGroupInviteList(@RequestBody AcceptGroupInviteQuery acceptGroupInviteQuery)throws Exception{
        return  wwGroupInviteService.getAccpetGroupInviteList(acceptGroupInviteQuery);
    }

    @ApiOperation(value = "设置自动接受群邀请开关", notes = "设置自动接受群邀请开关",response = Boolean.class)
    @PostMapping(value ="/setAutoAcceptInviteSwitch" )
    public Object setAutoAcceptInviteSwitch(@RequestBody AutoAcceptInviteSwitchDto autoAcceptInviteSwitchDto)throws Exception{
        wwGroupInviteService.setAutoAcceptInviteSwitch(autoAcceptInviteSwitchDto);
        return true;
    }

    @ApiOperation(value = "批量设置接受群邀请机器人配置", notes = "批量设置接受群邀请机器人配置",response = Boolean.class)
    @PostMapping(value ="/batchAddAcceptGroupInvite" )
    public Object batchAddAcceptGroupInvite(@RequestBody AcceptGroupInviteDto acceptGroupInviteDto)throws Exception{
        wwGroupInviteService.batchAddAcceptGroupInvite(acceptGroupInviteDto);
        return true;
    }


}
